package com.robot.base.common.api

import com.robot.base.model.QueryAppLatestVersionBean
import com.robot.base.model.QueryBinLatestVersionBean
import com.qihang.annotations.ApiFactory
import com.robot.base.model.FileBean
import io.reactivex.Observable
import me.goldze.mvvmhabit.http.BaseResponse
import okhttp3.MultipartBody
import retrofit2.http.*

@ApiFactory(value = GlBaseApi::class)
interface OtaService {
    //文件上传(支持jpg,png,gif,word,pdf,excel)（限制不能大于20M）
    @Multipart //这里用Multipart
    @POST("front/app/public/upload/whole")
    fun uploadWhole(@Part files: MultipartBody.Part): Observable<BaseResponse<FileBean>>
    //查询APP最新版本
    fun queryAppLatestVersion(@Body map: Map<String, String>): Observable<BaseResponse<QueryAppLatestVersionBean>>

    //查询固件最新版本
    @POST("api/ota/queryBinLatestVersion")
    fun queryBinLatestVersion(@Body map: Map<String, String>): Observable<BaseResponse<QueryBinLatestVersionBean>>
}